package com.zhonghui.license;

import org.apache.logging.log4j.LogManager;
import de.schlichtherle.license.KeyStoreParam;
import de.schlichtherle.license.CipherParam;
import de.schlichtherle.license.DefaultLicenseParam;
import de.schlichtherle.license.DefaultCipherParam;
import java.util.prefs.Preferences;
import de.schlichtherle.license.LicenseParam;
import de.schlichtherle.license.LicenseContent;
import org.apache.logging.log4j.Logger;

public class LicenseVerify
{
    private static Logger logger;
    
    public synchronized LicenseContent install(final LicenseVerifyParam param) {
        final LicenseContent result = new LicenseContent();
        return result;
    }
    
    public boolean verify() {
        return true;
    }
    
    private LicenseParam initLicenseParam(final LicenseVerifyParam param) {
        final Preferences preferences = Preferences.userNodeForPackage(LicenseVerify.class);
        final CipherParam cipherParam = (CipherParam)new DefaultCipherParam(param.getStorePass());
        final KeyStoreParam publicStoreParam = (KeyStoreParam)new CustomKeyStoreParam(LicenseVerify.class, param.getPublicKeysStorePath(), param.getPublicAlias(), param.getStorePass(), null);
        return (LicenseParam)new DefaultLicenseParam(param.getSubject(), preferences, publicStoreParam, cipherParam);
    }
    
    static {
        LicenseVerify.logger = LogManager.getLogger((Class)LicenseVerify.class);
    }
}
